/**
 * 代码中的类名、方法名、参数名已经指定，请勿修改，直接返回方法规定的值即可
 *
 * 反转数组的字符串
 * @param s string字符串一维数组 字符串数组
 * @return string字符串一维数组
 */
function reverseString (s) {
  // write code here
  let left = 0
  let right = s.length - 1
  while (left < right) {
    [s[left], s[right]] = [s[right], s[left]]
    left++
    right--
  }
  return s
}
let s = ["h", "e", "l", "l", "o"]
console.log(reverseString(s));
module.exports = {
  reverseString: reverseString
};